package view
{
	import flash.display.DisplayObjectContainer;
	import flash.display.Graphics;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	import utils.Coursor;
	
	public class ConsolePoint extends Sprite
	{
		public function ConsolePoint(parent:DisplayObjectContainer=null,xpos:Number=0,ypos:Number=0,hander:Function=null,fun2:Function=null)
		{
			this.x = xpos;
			this.y = ypos;
			graphics.beginFill(0xff0000,0);
			graphics.drawCircle(0,0,12);
			graphics.beginFill(0x000000);
			graphics.drawCircle(0,0,4);
			graphics.beginFill(0xffffff);
			graphics.drawCircle(0,0,2);
			graphics.endFill();
			if(parent != null)
			{
				parent.addChild(this);
			}
			this.addEventListener(MouseEvent.MOUSE_DOWN,hander);
			this.addEventListener(MouseEvent.MOUSE_MOVE,fun2);
			this.addEventListener(MouseEvent.MOUSE_OUT,onMouseout);
		}
		public function setXY(xpos:Number,ypos:Number):void{
			this.x = xpos;
			this.y = ypos;
		}
		private function onMouseout(event:MouseEvent):void{
			if(Console(this.parent.parent).change)
				Coursor.getInstance().removeCoursor();
		}
	}
}